package org.nf.shopping.service.Impl;

import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import org.nf.shopping.entity.Admin;
import org.nf.shopping.mapper.AdminMapper;
import org.nf.shopping.service.AdminService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author czl
 * @Date 2024-12-01
 */
@Service
@RequiredArgsConstructor
public class AdminServiceImpl implements AdminService {

    private final AdminMapper adminMapper;

    @Override
    public PageInfo<Admin> listAdmin(Integer pageSize, Integer pageNum, String name) {
        List<Admin> list = adminMapper.listAdmin(pageSize,pageNum,name);
        PageInfo<Admin> pageInfo =new PageInfo<>(list);
        return pageInfo;
    }

    @Override
    public void updateAdmin(Admin admin) {
        adminMapper.updateAdmin(admin);
    }

    @Override
    public void deloneAdmin(Integer id) {
        adminMapper.deloneAdmin(id);
    }

    @Override
    public void addAdmin(Admin admin) {
        adminMapper.addAdmin(admin);
    }

    @Override
    public List<Admin> getAdminList() {
        return adminMapper.getAdminList();
    }
}
